home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / demo / demosrc / d_slice.pro < prev    next >
Text File  |  1997-07-08  |  1KB  |  48 lines

  1. ; $Id: d_slice.pro,v 1.8 1997/04/19 00:00:47 dave Exp $
  2. PRO d_slice, $
  3.     GROUP=group, $          ; IN: (opt) group identifier
  4.     APPTLB = appTLB         ; OUT: (opt) TLB of this application
  5.  
  6.     ; Check the validity of the group identifier.
  7.     ;
  8.     ngroup = N_ELEMENTS(group)
  9.     if (ngroup NE 0) then begin
  10.         check = WIDGET_INFO(group, /VALID_ID)
  11.         if (check NE 1) then begin
  12.             print,'Error, the group identifier is not valid'
  13.             print, 'Return to the main application'
  14.             RETURN
  15.         endif
  16.         groupBase = group
  17.     endif else groupBase = 0L
  18.  
  19.     ;  Get the current color vectors to restore 
  20.     ;  when this application is exited.
  21.     ;
  22.     TVLCT, savedR, savedG, savedB, /GET
  23.  
  24.    head = Bytarr(80, 100, 57, /Nozero)
  25.    Openr, lun, filepath('head.dat', $
  26.        SUBDIR=['examples','data']), $
  27.        /GET_LUN
  28.    Readu, lun, head
  29.    free_lun, lun
  30.  
  31.    h_data = Handle_Create(Value=head, /no_copy)
  32.    Slicer3, h_data, /Modal
  33.    Handle_Free, h_data
  34.  
  35.     ;  Restore the saved color vectors
  36.     ;
  37.     TVLCT, savedR, savedG, savedB
  38.  
  39.     if widget_info(groupBase, /valid) then $
  40.         widget_control, groupBase, /map
  41.  
  42.     ;  d_slice is a special case and does not return a valid appTLB
  43.     ;  but it needs to return the argument in any case, as all demos
  44.     ;  are called with the same calling convention
  45.     appTLB = 0L
  46. END
  47.  
  48.